package File;

import java.io.*;

public class Demo11 {
    public static void main(String[] args) throws IOException {
        File file = new File("test.txt");
        try (InputStream inputStream = new FileInputStream(file)) {
            while (true) {
                int n = inputStream.read();
                if (n == -1) {//读取结束
                    break;
                }
//                System.out.printf("0x%x\n", n);//16进制输出
//                System.out.println(n);//ascii码输出
                System.out.print((char)n);//字符类型输出
            }
        }

    }
}
